<?php

namespace app\xcxapi\controller\v1;

use app\common\controller\XcxController;
use app\xcxapi\service\RemedialService;

class Remedial extends XcxController
{
	/**
	 * 列表
	 * User: chenben
	 * Date: 2020/04/20
	 *
	 */
    public function remedialLists()
    {
        if ($this->request->isPost()) {
            $params = $this->request->param();
            $list = (new RemedialService($this->type))->remedialLists($params);
            if (1 !== $list['code']) {
                $this->fail($list);
            }
            $this->win($list);
        }
        $this->fail('ILLEGAL_REQUEST');
    }

    /**
     * 删除
     * User: chenben
     * Date: 2020/02/19.
     */
    public function remedialDel()
    {
        if ($this->request->isPost()) {
            $params = $this->request->param();
            $list = (new RemedialService($this->type))->remedialDel($params);
            if (1 !== $list['code']) {
                $this->fail($list);
            }
            $this->win($list);
        }
        $this->fail('ILLEGAL_REQUEST');
    }
	
	/**
	 * 插入补课班级
     * User: chenben
     * Date: 2020/04/18.
     */
    public function remedialInsertStudentInfos()
    {
        if ($this->request->isPost()) {
            $params = $this->request->param();
            $list = (new RemedialService($this->type))->remedialInsertStudentInfos($params);
            if (1 !== $list['code']) {
                $this->fail($list);
            }
            $this->win($list);
        }
        $this->fail('ILLEGAL_REQUEST');
    }

    /**
	 * 跟班补课
     * User: chenben
     * Date: 2020/02/19.
     */
    public function remedialFollowGrade()
    {
        if ($this->request->isPost()) {
            $params = $this->request->param();
            $list = (new RemedialService($this->type))->remedialFollowGrade($params);
            if (1 !== $list['code']) {
                $this->fail($list);
            }
            $this->win($list);
        }
        $this->fail('ILLEGAL_REQUEST');
    }

    /**
     * User: chenben
     * Date: 2020/02/19.
     */
    public function remedialFollowClass()
    {
        if ($this->request->isPost()) {
            $params = $this->request->param();
            $list = (new RemedialService($this->type))->remedialFollowClass($params);
            if (1 !== $list['code']) {
                $this->fail($list);
            }
            $this->win($list);
        }
        $this->fail('ILLEGAL_REQUEST');
    }

    /**
     * User: chenben
     * Date: 2020/02/19.
     *
     * @return mixed
     */
    public function remedialLessonClass()
    {
		if ($this->request->isPost()) {
			$params = $this->request->param();
			$list = (new RemedialService($this->type))->remedialLessonClass($params);
			if (1 !== $list['code']) {
				$this->fail($list);
			}
			$this->win($list);
		}
		$this->fail('ILLEGAL_REQUEST');
    }
}
